﻿using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using weikebuluo.DAL;
using weikebuluo.Model;
using weikebuluo.Common;

namespace weikebuluo.web.wechat.party
{
    public partial class ordlist : System.Web.UI.Page
    {
        TB_DK_ProList_DAL prolistdal = new TB_DK_ProList_DAL();
        protected DataTable dt = new DataTable();
        JsonOperate JsonOperate = new JsonOperate();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["uid"])) {
                dt = prolistdal.GetList("user_id=" + Request.QueryString["uid"]).Tables[0];
            }
            switch (Request.QueryString["action"])
            {
                case "list":
                    list();
                    break;
            }
        }
        /// <summary>
        ///查询
        /// </summary>
        public void list()
        {
            string where = "user_id=" + Request.QueryString["uid"];
            int Page = int.Parse(Request.Form["page"]);
            int RecordCount = prolistdal.GetRecordCount(where);
            DataTable dtfoodlist = prolistdal.GetListByPage(where, "", ((Page - 1) * 10) + 1, (Page - 1) * 10 + 10).Tables[0];
            Response.Write(JsonOperate.GetDataGridJson(dtfoodlist, RecordCount));
            Response.End();
        }
    }
}